//
//  Target_Discover.m
//  CharonTVProject
//
//  Created by karong on 2023/7/31.
//

#import "Target_Discover.h"
#import "WSDiscoverItemController.h"
#import "WSSeachDefaulController.h"
#import "WSSearchResultController.h"
#import "WSChannelMoreController.h"
#import "WSFavoritesController.h"

@implementation Target_Discover
- (id)Action_charonTV_channel:(NSDictionary *)params {
    WSDiscoverItemController * targetVC = (WSDiscoverItemController *)[self instantiateViewControllerWithStoryboardNam:@"WSDiscoverController" identifier:@"WSDiscoverItemController"];
    targetVC.channel = params[@"channel"];
    return targetVC;
}

- (id)Action_charonTV_search:(NSDictionary *)params {
    WSSeachDefaulController * targetVC = (WSSeachDefaulController *)[self instantiateViewControllerWithName:@"WSSeachDefaulController"];
    return targetVC;
}

- (id)Action_charonTV_searchResult:(NSDictionary *)params {
    WSSearchResultController * targetVC = (WSSearchResultController *)[self instantiateViewControllerWithStoryboardNam:@"WSSeachDefaulController" identifier:@"WSSearchResultController"];
    return targetVC;
}

- (id)Action_charonTV_channelMore:(NSDictionary *)params {
    WSChannelMoreController * targetVC = (WSChannelMoreController *)[self instantiateViewControllerWithName:@"WSChannelMoreController"];
    targetVC.charonTV_sort_type = [params[@"charonTV_sort_type"] integerValue];
    return targetVC;
}

- (id)Action_charonTV_favorites:(NSDictionary *)params {
    WSFavoritesController * targetVC = (WSFavoritesController *)[self instantiateViewControllerWithName:@"WSFavoritesController"];
    return targetVC;
}

- (UIViewController *)instantiateViewControllerWithName:(NSString *)name {
   return [self instantiateViewControllerWithStoryboardNam:name identifier:name];
}

- (UIViewController *)instantiateViewControllerWithStoryboardNam:(NSString *)storyboard identifier:(NSString *)identifier{
   return [[UIStoryboard storyboardWithName:storyboard bundle:nil] instantiateViewControllerWithIdentifier:identifier];
}

@end
